<%@page import="java.net.URLEncoder"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
<%
Integer load=(Integer)session.getAttribute("loading");
int count=0;
if(load==null){
	count=1;
}else{
	count++;
}
session.setAttribute("loading",count);
out.print(count+"次");
String user=request.getParameter("user");
String pass=request.getParameter("pass");
%>
<%
	if(user.equals("lucky")&&pass.equals("123456")){
		session.setAttribute("loading",user);
		request.getRequestDispatcher("success.jsp").forward(request,response);
		return;
	}else{
		String info="失败";
		info=URLEncoder.encode(info,"utf-8");
		response.sendRedirect(request.getContextPath()+"/form.jsp?info="+info);
	}
%>
</body>
</html>